const Router = require('koa-router');
const tool = require("../../tools/tool");
const router = new Router();
const {db, Op, QueryTypes} = require("../../models/db");
router.post('/app/getGoodCat', async ctx => {
    let tenantId= ctx.user.tenantId
    let uid= ctx.user.id
    let body= ctx.request.body;
    let model = await db.query(`SELECT DISTINCT categoryId id,goodCatName name FROM v_goods where tenantId=${tenantId} and goodCatName is not null `, {type: QueryTypes.SELECT})

    return ctx.suc('', model)
})



module.exports = router;